//
//  SelectItem.h
//  TycoonSale
//
//  Created by molon on 15/7/29.
//  Copyright (c) 2015年 molon. All rights reserved.
//

#import "Model.h"
#import "ModelArray.h"

@interface SelectItem : Model

@property(nonatomic,copy) NSString *ID;
@property(nonatomic,copy) NSString *name;
@property(nonatomic,assign) BOOL selected;

@end

@interface SelectItemArray : ModelArray

//简单的例如@[@"男",@"女"]转换为SelectItemArray ，ID设置为index，第一个默认选择
+ (instancetype)selectItemsWithNames:(NSArray*)names;


//单选某项
- (void)singleSelectWithItem:(SelectItem*)item;
- (SelectItem*)singleSelectWithItemID:(NSString*)ID;
//当前单选项目
- (NSInteger)singleSelectedItemIndex;
- (SelectItem*)singleSelectedItem;

//多选某些项
- (void)multiSelectWithIDs:(NSArray*)ids;
- (void)multiSelectAll;
- (void)multiUnselectAll;
//当前多选
- (SelectItemArray*)multiSelectedItems;
- (NSArray*)multiSelectedItemIDs;

@end

@interface RegionSelectItem : SelectItem

@property (nonatomic, copy) NSString *firstLetter;

@end

@interface RegionSelectItemArray : SelectItemArray

@end